home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1271 / wsc4vb_r.doc < prev    next >
Text File  |  1997-03-19  |  45KB  |  1,383 lines

  1.  
  2.  
  3.  
  4.                      Windows Standard Communications
  5.  
  6.                            Library for Visual Basic
  7.  
  8.                                  (WSC4VB)
  9.  
  10.  
  11.                             REFERENCE MANUAL
  12.  
  13.  
  14.  
  15.                                Version 2.0
  16.  
  17.                               March 15, 1997
  18.  
  19.  
  20.  
  21.  
  22.                      This software is provided as-is.
  23.               There are no warranties, expressed or implied.
  24.  
  25.  
  26.  
  27.  
  28.                          Copyright (C) 1996-1997
  29.                            All rights reserved
  30.  
  31.  
  32.  
  33.                        MarshallSoft Computing, Inc.
  34.                            Post Office Box 4543
  35.                            Huntsville AL 35815
  36.  
  37.                            Voice : 205-881-4630
  38.                              FAX : 205|880|0925
  39.                              BBS : 205-880-9748
  40.                            email : info@marshallsoft.com
  41.                              web : www.marshallsoft.com
  42.  
  43.                                _______
  44.                           ____|__     |                (R)
  45.                        --+       |    +-------------------
  46.                          |   ____|__  |  Association of
  47.                          |  |       |_|  Shareware
  48.                          |__|   o   |    Professionals
  49.                        --+--+   |   +---------------------
  50.                             |___|___|    MEMBER
  51.  
  52.  
  53.       MARSHALLSOFT is a trademark of MarshallSoft Computing, Inc.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.      WSC4VB Reference Manual                                   Page 1
  61.  
  62.                             C O N T E N T S
  63.  
  64.  
  65.  
  66.         Chapter                                     Page
  67.  
  68.         Table of Contents.............................2
  69.  
  70.         WSC Functions.................................4
  71.  
  72.            SioBaud....................................4
  73.            SioBrkSig..................................4
  74.            SioCTS.....................................5
  75.            SioDCD.....................................5
  76.            SioDone....................................6
  77.            SioDSR.....................................6
  78.            SioDTR.....................................7
  79.            SioFlow....................................7
  80.            SioGetc....................................8
  81.            SioGets....................................8
  82.            SioInfo....................................9
  83.            SioParms...................................9
  84.            SioPutc...................................10
  85.            SioPuts...................................10
  86.            SioReset..................................11
  87.            SioRI.....................................11
  88.            SioRTS....................................12
  89.            SioRxClear................................12
  90.            SioRxQue..................................13
  91.            SioStatus.................................13
  92.            SioTxClear................................14
  93.            SioTxQue..................................14
  94.            SioUnGetc.................................15
  95.  
  96.         WSC Error Codes..............................15
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      WSC4VB Reference Manual                                   Page 2
  121.  
  122.                             C O N T E N T S
  123.  
  124.                               (continued)
  125.  
  126.  
  127.  
  128.         Chapter                                     Page
  129.  
  130.         Modem I/O Functions..........................16
  131.  
  132.            mioBreak..................................16
  133.            mioDriver.................................16
  134.            mioQuiet..................................17
  135.            mioResult.................................17
  136.            mioSendTo.................................18
  137.            mioWaitFor................................18
  138.  
  139.         XYDRIVER Functions...........................19
  140.  
  141.            xyAbort...................................19
  142.            xyAcquire.................................19
  143.            xyDebug...................................20
  144.            xyDriver..................................20
  145.            xyGetMessage..............................21
  146.            xyGetParameter............................21
  147.            xyRelease.................................22
  148.            xyStartRx.................................22
  149.            xyStartTx.................................23
  150.  
  151.         XYDRIVER Error Codes.........................23
  152.  
  153.       NOTE: DefInt is assumed for all functions in the Win16 library while
  154.       DefLng is asumed for all functions in the Win32 library. Also note
  155.       that all arguments are passed by value except for strings.
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      WSC4VB Reference Manual                                   Page 3
  181.  
  182.       +-------------+-----------------------------------------------------+
  183.       |   SioBaud   |  Sets the baud rate.                                |
  184.       +-------------+-----------------------------------------------------+
  185.  
  186.  
  187.       Syntax Function SioBaud(ByVal Port, ByVal BaudCode)
  188.              ' Port     : Port selected.
  189.              ' BaudCode : Baud code or actual baud rate.
  190.  
  191.       Remark The SioBaud Function sets the baud rate without resetting
  192.              the port. It is used to change the baud rate after calling
  193.              SioReset.
  194.  
  195.              SioBaud may be called with either the actual baud rate value
  196.              or one of the baud rate codes as follows:
  197.  
  198.                Code   Rate    Name             Code   Rate   Name
  199.                  0     300    Baud300            5    9600   Baud9600
  200.                  1     600    Baud600            6   19200   Baud19200
  201.                  2    1200    Baud1200           7   38400   Baud38400
  202.                  3    2400    Baud2400           8   57600   Baud57600
  203.                  4    4800    Baud4800           9  115200   Baud115200
  204.  
  205.       Return    IE_BADID : No such port.
  206.              IE_BAUDRATE : Unsupported baud rate.
  207.  
  208.        Other See SioReset.
  209.  
  210.  
  211.  
  212.       +-------------+-----------------------------------------------------+
  213.       |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.         |
  214.       +-------------+-----------------------------------------------------+
  215.  
  216.       Syntax Function SioBrkSig(ByVal PortCmd)
  217.              ' Port : Port selected.
  218.              ' Cmd  : ASSERT, CANCEL, or DETECT.
  219.  
  220.       Remark The SioBrkSig Function controls the BREAK bit in the line
  221.              status register. The legal commands are:
  222.  
  223.              ASSERT_BREAK : 'A' to assert BREAK
  224.              CANCEL_BREAK : 'C' to cancel BREAK
  225.              DETECT_BREAK : 'D' to detect BREAK
  226.  
  227.              ASSERT_BREAK, CANCEL_BREAK, and DETECT_BREAK are defined in
  228.              WSC4VB.PAS. See MODEM.C for an example of the use of SioBrkSig.
  229.  
  230.       Return  IE_NOPEN : Port not opened. Call SioReset first.
  231.               IE_BADID : No such port.
  232.              WSC_RANGE : Illegal command. Expected 'A', 'C', or 'D'.
  233.                     >0 : BREAK signal detected (DETECT command only)
  234.  
  235.        Other See SioBrkKey.
  236.  
  237.  
  238.  
  239.  
  240.      WSC4VB Reference Manual                                   Page 4
  241.  
  242.       +-------------+-----------------------------------------------------+
  243.       |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.    |
  244.       +-------------+-----------------------------------------------------+
  245.  
  246.       Syntax Function SioCTS(ByVal Port)
  247.              ' Port : Port selected.
  248.  
  249.       Remark The SioCTS Function is used to detect if CTS (Clear To Send)
  250.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  251.              cannot read the CTS bit correctly!
  252.  
  253.              The CTS line is used by some error correcting modems to
  254.              implement hardware flow control.  CTS is dropped by the modem
  255.              to signal the computer not to send data and is raised to
  256.              signal the computer to continue.
  257.  
  258.              Refer to the User's Manual for a discussion of flow control.
  259.  
  260.       Return IE_NOPEN : Port not opened. Call SioReset first.
  261.              IE_BADID : No such port.
  262.                     0 : CTS has not changed.
  263.                    >0 : CTS has changed.
  264.  
  265.        Other See SioFlow, SioDSR, SioRI, SioDCD, and SioModem.
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.       +-------------+-----------------------------------------------------+
  281.       |   SioDCD    |  Reads the Data Carrier Detect (DCD) modem staus bit|
  282.       +-------------+-----------------------------------------------------+
  283.  
  284.       Syntax Function SioDCD(ByVal Port)
  285.              ' Port : Port selected.
  286.  
  287.       Remark The SioDCD Function is used to read the Data Carrier Detect
  288.              (DCD) modem status bit. Also see SioModem.
  289.  
  290.       Return IE_NOPEN : Port not opened. Call SioReset first.
  291.              IE_BADID : No such port.
  292.                     0 : DCD is clear.
  293.                    >0 : DCD is set.
  294.  
  295.        Other See SioDSR, SioCTS, SioRI, and SioModem.
  296.  
  297.  
  298.  
  299.  
  300.      WSC4VB Reference Manual                                   Page 5
  301.  
  302.       +-------------+-----------------------------------------------------+
  303.       |   SioDone   |  Terminates further serial processing.              |
  304.       +-------------+-----------------------------------------------------+
  305.  
  306.       Syntax Function SioDone(ByVal Port)
  307.              ' Port : Port selected.
  308.  
  309.       Remark The SioDone Function terminates further serial processing,
  310.              allowing other applications to use the port.
  311.  
  312.       Return IE_NOPEN : Port not opened. Call SioReset first.
  313.              IE_BADID : No such port.
  314.  
  315.        Other See SioReset.
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.       +-------------+-----------------------------------------------------+
  326.       |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.   |
  327.       +-------------+-----------------------------------------------------+
  328.  
  329.       Syntax Function SioDSR(ByVal Port)
  330.              ' Port : Port selected.
  331.  
  332.       Remark The SioDSR Function is used to detect if DSR (Data Set Ready)
  333.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  334.              cannot read the DSR bit correctly!
  335.  
  336.       Return IE_NOPEN : Port not opened. Call SioReset first.
  337.              IE_BADID : No such port.
  338.                     0 : DSR has not changed.
  339.                    >0 : DSR has changed.
  340.  
  341.        Other See SioCTS, SioRI, and SioDCD.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      WSC4VB Reference Manual                                   Page 6
  361.  
  362.       +-------------+-----------------------------------------------------+
  363.       |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR).     |
  364.       +-------------+-----------------------------------------------------+
  365.  
  366.       Syntax Function SioDTR(ByVal PortCmd)
  367.              ' Port : Port selected.
  368.              ' Cmd  : DTR command (see below).
  369.  
  370.       Remark The SioDTR Function controls the Data Terminal Ready (DTR) bit
  371.              in the modem control register.  DTR should always be set when
  372.              communicating with a modem.  Commands (defined in WSC4VB.PAS):
  373.  
  374.                   SET_LINE   : 'S'  to set DTR (ON)
  375.                   CLEAR_LINE : 'C'  to clear DTR (OFF)
  376.                   READ_LINE  : 'R'  to read DTR
  377.  
  378.       Return IE_NOPEN  : Port not opened. Call SioReset first.
  379.              IE_BADID  : No such port.
  380.              WSC_RANGE : Not one of 'S', 'C', or 'R'.
  381.                      0 : DTR is OFF (READ_LINE Command).
  382.                     >0 : DTR is ON (READ_LINE Command).
  383.  
  384.        Other See SioRTS.
  385.  
  386.       +------------+------------------------------------------------------+
  387.       |   SioFlow  |  Sets flow control.                                  |
  388.       +------------+------------------------------------------------------+
  389.  
  390.       Syntax Function SioFlow(ByVal PortCmd)
  391.              ' Port : Port selected.
  392.              ' Cmd  : Class of flow control (see below).
  393.  
  394.       Remark The SioFlow Function is used to enable or disable hardware
  395.              flow control.  Hardware flow control uses RTS and CTS to
  396.              control data flow between the modem and the computer.  To
  397.              enable flow control, call SioFlow with Cmd set to:
  398.  
  399.                   Cmd  Flow Control
  400.                   'H'  Hardware (RTS/CTS) flow control.
  401.                   'S'  Software (XON/XOFF) flow control.
  402.                   'N'  No flow control.
  403.  
  404.              In order for hardware flow control to work correctly, your
  405.              modem must also be configured to work with hardware flow
  406.              control, and your computer to modem cable must have RTS and
  407.              CTS wired straight through. If you enable hardware flow
  408.              control, do not modify the RTS line (by calling SioRTS). Flow
  409.              control is disabled after resetting a port.
  410.  
  411.       Return IE_NOPEN : Port not opened. Call SioReset first.
  412.              IE_BADID : No such port.
  413.             WSC_RANGE : Cannot recognize Cmd.
  414.                   -1  : Flow control disabled.
  415.                   >0  : Flow control enabled.
  416.  
  417.        Other See SioPutc
  418.  
  419.  
  420.      WSC4VB Reference Manual                                   Page 7
  421.  
  422.       +------------+------------------------------------------------------+
  423.       |   SioGetc  |  Reads the next character from the serial line.      |
  424.       +------------+------------------------------------------------------+
  425.  
  426.       Syntax Function SioGetc(ByVal Port)
  427.              ' Port : Port selected.
  428.  
  429.       Remark The SioGetc Function reads a byte from the selected serial
  430.              port. WSC_NO_DATA (-100) is returned if no byte is available.
  431.  
  432.  
  433.       Return    IE_NOPEN : Port not opened. Call SioReset first.
  434.                 IE_BADID : No such port.
  435.              WSC_NO_DATA : If timed out (no data available).
  436.                     >= 0 : Character read.
  437.  
  438.        Other See SioUnGetc and SioGets.
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.       +------------+------------------------------------------------------+
  448.       |   SioGets  |  Reads the next byte buffer from the serial line.    |
  449.       +------------+------------------------------------------------------+
  450.  
  451.       Syntax Function SioGetc(ByVal Port, Buffer As String, ByVal Cnt)
  452.              ' Port   : Port selected.
  453.              ' Buffer : Receive buffer.
  454.              ' Cnt    : Number bytes wanted.
  455.  
  456.       Remark The SioGets Function reads the smaller of the number of bytes
  457.              wanted (Cnt) and the number of bytes in the receive buffer. A
  458.              zero is return if no bytes are read.
  459.  
  460.  
  461.       Return IE_NOPEN : Port not opened. Call SioReset first.
  462.              IE_BADID : No such port.
  463.                  >= 0 : Number of characters actually read.
  464.  
  465.        Other See SioUnGetc and SioPutc.
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.      WSC4VB Reference Manual                                   Page 8
  481.  
  482.       +-------------+-----------------------------------------------------+
  483.       |   SioInfo   |  Returns WSC4VB library information.                |
  484.       +-------------+-----------------------------------------------------+
  485.  
  486.       Syntax Function SioInfo(ByVal Cmd)
  487.              ' Cmd : Command (See below).
  488.  
  489.       Remark The SioInfo Function returns an integer code corresponding to
  490.              the Cmd as follows.
  491.  
  492.                   Command   SioInfo returns
  493.                     'V'     Library version number.
  494.  
  495.  
  496.       Return See remarks above.
  497.              -1 : Cannot recognize Cmd.
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.       +-------------+-----------------------------------------------------+
  505.       |  SioParms   |  Sets parity, stop bits, and word length.           |
  506.       +-------------+-----------------------------------------------------+
  507.  
  508.  
  509.       Syntax Function SioParms(ByVal Port, ByVal Parity,
  510.                                ByVal StopBits, ByVal DataBits)
  511.              ' Port     : Port selected.
  512.              ' Parity   : Parity code [0,1,2].
  513.              ' StopBits : Stop bits code [0,1].
  514.              ' DataBits : Word length code [0,1,2,3].
  515.  
  516.       Remark The SioParms Function sets the parity, stop bits, and word
  517.              length.  If the default parity (none), stop bits (1), or word
  518.              length (8) is not acceptable, then they can be changed by
  519.              calling SioParms.  SioParms can be called either before or
  520.              after calling SioReset. See file WSC4VB.PAS.
  521.  
  522.              Use the constant values defined in WSC4VB.PAS to minimize the
  523.              chance of passing an incorrect parameter value.
  524.  
  525.                Parity : NoParity, OddParity, EvenParity.
  526.              StopBits : OneStopBit, TwoStopBits.
  527.              DataBits : WordLength7, WorldLength8.
  528.  
  529.       Return    IE_BADID : No such port.
  530.              IE_BYTESIZE : Word length not supported.
  531.                WSC_RANGE : Parameter out of range.
  532.  
  533.        Other See SioReset.
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.      WSC4VB Reference Manual                                   Page 9
  541.  
  542.       +-------------+-----------------------------------------------------+
  543.       |   SioPutc   |  Transmit a character over a serial line.           |
  544.       +-------------+-----------------------------------------------------+
  545.  
  546.       Syntax Function SioPutc(ByVal PortCh)
  547.              ' Port : Port selected.
  548.              ' Ch   : Character to send.
  549.  
  550.       Remark The SioPutc Function copies the character to the transmit
  551.              queue for subsequent transmission.
  552.  
  553.       Return IE_NOPEN : Port not opened. Call SioReset first.
  554.              IE_BADID : No such port.
  555.                     0 : No error.
  556.  
  557.        Other See SioGetc and SioFlow.
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.       +-------------+-----------------------------------------------------+
  569.       |   SioPuts   |  Transmits a byte buffer over a serial line.        |
  570.       +-------------+-----------------------------------------------------+
  571.  
  572.       Syntax Function SioPuts(ByVal Port, Buffer As String, ByVal Cnt)
  573.              ' Port   : Port selected.
  574.              ' Buffer : String of bytes to transmit.
  575.  
  576.       Remark The SioPuts Function copies the characters to the transmit
  577.              queue for subsequent transmission.
  578.  
  579.  
  580.       Return IE_NOPEN : Port not opened. Call SioReset first.
  581.              IE_BADID : No such port.
  582.                  >= 0 : The number of bytes actually transmitted.
  583.  
  584.        Other See SioGetc and SioFlow.
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.      WSC4VB Reference Manual                                   Page 10
  601.  
  602.       +-------------+-----------------------------------------------------+
  603.       |  SioReset   |  Initialize a serial port for processing.           |
  604.       +-------------+-----------------------------------------------------+
  605.  
  606.       Syntax Function SioReset(ByVal Port,
  607.                                ByVal RxQueSize,ByVal TxQueSize)
  608.              ' Port      : Port selected.
  609.              ' RxQueSize : Receive queue size.
  610.              ' TxQueSize : Transmit queue size.
  611.  
  612.       Remark The SioReset Function initializes the selected serial port.
  613.              SioReset should be called before making any other calls to
  614.              WSC4VB.  SioReset uses the parity, stop bits, and word length
  615.              value previously set if SioParm was called, otherwise the
  616.              default values (see SioParm) are used.
  617.  
  618.       Return    IE_BADID : No such port.
  619.                  IE_OPEN : Already open.
  620.                IE_MEMORY : Cannot allocate memory.
  621.              IE_HARDWARE : Hardware error.
  622.  
  623.        Other See SioBaud, SioParms, and SioDone.
  624.  
  625.  
  626.  
  627.  
  628.  
  629.       +-------------+-----------------------------------------------------+
  630.       |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.    |
  631.       +-------------+-----------------------------------------------------+
  632.  
  633.       Syntax Function SioRI(ByVal Port)
  634.              ' Port : Port selected.
  635.  
  636.       Remark The SioRI Function is used to read the Ring Indicator (RI)
  637.              modem status bit.
  638.  
  639.       Return IE_NOPEN : Port not opened. Call SioReset first.
  640.              IE_BADID : No such port.
  641.                     0 : RI is clear.
  642.                    >0 : RI is set (RING has occurred).
  643.  
  644.        Other See SioDSR, SioCTS, and SioDCD.
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.      WSC4VB Reference Manual                                   Page 11
  661.  
  662.       +-------------+-----------------------------------------------------+
  663.       |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS).  |
  664.       +-------------+-----------------------------------------------------+
  665.  
  666.       Syntax Function SioRTS(ByVal PortCmd)
  667.              ' Port : Port selected.
  668.              ' Cmd  : RTS command (SET, CLEAR, or READ).
  669.  
  670.       Remark The SioRTS Function controls the Request to Send (RTS bit in
  671.              the modem control register.
  672.  
  673.              The RTS line is used by some error correcting modems to
  674.              implement hardware flow control.  RTS is dropped by the
  675.              computer to signal the modem not to send data, and is raised
  676.              to signal the modem to continue. RTS should be set when
  677.              communicating with a modem unless Flow Control is being used.
  678.  
  679.              Refer to the User's Manual for a discussion of flow control.
  680.              Commands (defined in WSC4VB.PAS) are:
  681.  
  682.                     SET_LINE  'S' : set RTS (ON)
  683.                   CLEAR_LINE  'C' : clear RTS (OFF)
  684.                    READ_LINE  'R' : read RTS
  685.  
  686.       Return  IE_NOPEN : Port not opened. Call SioReset first.
  687.               IE_BADID : No such port.
  688.              WSC_RANGE : Command is not one of 'S', 'C', or 'R'.
  689.                      0 : RTS is OFF ('R' command).
  690.                     >0 : RTS is ON  ('R' command).
  691.  
  692.        Other See SioFlow and SioDTR.
  693.  
  694.  
  695.  
  696.  
  697.  
  698.       +------------+------------------------------------------------------+
  699.       | SioRxClear |  Clears the receive buffer.                          |
  700.       +------------+------------------------------------------------------+
  701.  
  702.       Syntax Function SioRxClear(ByVal Port)
  703.              ' Port : Port selected.
  704.  
  705.       Remark The SioRxClear Function will delete any characters in the
  706.              receive buffer for the specified port.  After execution, the
  707.              receive buffer will be empty.
  708.  
  709.       Return IE_NOPEN : Port not opened. Call SioReset first.
  710.              IE_BADID : No such port.
  711.  
  712.        Other See SioRxQue.
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.      WSC4VB Reference Manual                                   Page 12
  721.  
  722.       +-------------+-----------------------------------------------------+
  723.       |  SioRxQue   |  Returns the number of bytes in the receive queue.  |
  724.       +-------------+-----------------------------------------------------+
  725.  
  726.       Syntax Function SioRxQue(ByVal Port)
  727.              ' Port : Port selected.
  728.  
  729.       Remark The SioRxQue Function will return the number of characters in
  730.              the receive queue at the time of the call.
  731.  
  732.       Return IE_NOPEN : Port not opened. Call SioReset first.
  733.              IE_BADID : No such port.
  734.  
  735.        Other See SioRxFlush.
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.       +------------+------------------------------------------------------+
  743.       | SioStatus  |  Returns the serial port status.                     |
  744.       +------------+------------------------------------------------------+
  745.  
  746.       Syntax Function SioStatus(ByVal PortMask)
  747.              ' Port : Port selected.
  748.              ' Mask : Error mask.
  749.  
  750.       Remark The SioStatus Function returns the serial port error status
  751.              corresponding to the Mask argument.
  752.  
  753.                 WSC_RXOVER  : The receive queue overflowed.
  754.                 WSC_OVERRUN : An incoming byte was overwritten.
  755.                  WSC_PARITY : A parity error was detected (incoming byte)
  756.                   WSC_FRAME : A framing error was detected (incoming byte)
  757.                   WSC_BREAK : A break signal was detected.
  758.                  WSC_TXFULL : The transmit queue is full.
  759.  
  760.              For example, to test for receive queue overflow:
  761.  
  762.                If SioStatus(Port, WSC_RXOVER) > 0 Then
  763.                  Print "RX Overflow"
  764.                End if
  765.  
  766.              The nummerical values of the mask constants are defined in
  767.              WSC4VB.PAS.
  768.  
  769.       Return IE_NOPEN : Port not opened. Call SioReset first.
  770.              IE_BADID : No such port.
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.      WSC4VB Reference Manual                                   Page 13
  781.  
  782.       +------------+------------------------------------------------------+
  783.       | SioTxClear |  Clears the transmitter buffer.                      |
  784.       +------------+------------------------------------------------------+
  785.  
  786.       Syntax Function SioTxClear(ByVal Port)
  787.              ' Port : Port selected.
  788.  
  789.       Remark The SioTxClear Function will delete any characters in the
  790.              transmit buffer for the specified port.
  791.  
  792.              Once this Function is called, any character in the transmit
  793.              buffer (put there by SioPutc) will be lost and therefore not
  794.              transmitted.
  795.  
  796.       Return IE_NOPEN : Port not opened. Call SioReset first.
  797.              IE_BADID : No such port.
  798.  
  799.        Other See SioTxQue & SioTxFlush.
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.       +------------+------------------------------------------------------+
  809.       |  SioTxQue  |  Returns the number of bytes in the transmit queue.  |
  810.       +------------+------------------------------------------------------+
  811.  
  812.       Syntax Function SioTxQue(ByVal Port)
  813.              ' Port : Port selected.
  814.  
  815.       Remark The SioTxQue Function will return the number of characters in
  816.              the transmit queue at the time of the call.
  817.  
  818.       Return IE_NOPEN : Port not opened. Call SioReset first.
  819.              IE_BADID : No such port.
  820.  
  821.        Other See SioTxFlush.
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.      WSC4VB Reference Manual                                   Page 14
  841.  
  842.       +------------+-----+------------------------------------------------+
  843.       | SioUnGetc  |  .Un|gets. the last character read with SioGetc().   |
  844.       +------------+-----+------------------------------------------------+
  845.  
  846.       Syntax Function SioUnGetc(ByVal Port, ByVal Ch)
  847.              ' Port : Port selected.
  848.              ' Ch   : Character to unget.
  849.  
  850.       Remark The SioUnGetc Function returns (.pushes.) the character back
  851.              into the serial input buffer.  The character pushed will be
  852.              the next character returned by SioGetc.  Only one character
  853.              can be pushed back. This Function works just like the
  854.              .ungetc. Function in the C language.
  855.  
  856.       Return IE_NOPEN : Port not opened. Call SioReset first.
  857.              IE_BADID : No such port.
  858.  
  859.        Other See SioReset.
  860.  
  861.  
  862.  
  863.  
  864.                           WSC Error Codes
  865.  
  866.  
  867.       +---------------+---------------------------------------------+
  868.       |  WSC_NO_DATA  |  No incoming serial data is available.      |
  869.       |  WSC_RANGE    |  A parameter is out of range.               |
  870.       |  WSC_ABORTED  |  The shareware version of WSC corrupted.    |
  871.       |  WSC_WIN32ERR |  Win32 system error.                        |
  872.       |  WSC_EXPIRED  |  The shareware version of WSC has expired.  |
  873.       +---------------+---------------------------------------------+
  874.       |  IE_BADID     |  No such port.                              |
  875.       |  IE_OPEN      |  Port already opened.                       |
  876.       |  IE_NOPEN     |  Port not opened. Call SioReset first.      |
  877.       |  IE_MEMORY    |  Cannot allocate memory for queues.         |
  878.       |  IE_DEFAULT   |  Error in default parameters.               |
  879.       |  IE_HARDWARE  |  Hardware not present.                      |
  880.       |  IE_BYTESIZE  |  Unsupported byte size.                     |
  881.       |  IE_BAUDRATE  |  Unsupported baud rate.                     |
  882.       +---------------+---------------------------------------------+
  883.  
  884.       The WSC_EXPIRED error occurs when in the shareware DLL only. It
  885.       limits the execution of an WSC DLL to 20 minutes of execution. The
  886.       application must be restarted to continue serial processing.
  887.  
  888.       The WSC_ABORTED error occurs in the shareware version only if there
  889.       is a problem displaying the shareware screen.
  890.  
  891.       The WSC_WIN32ERR error code is returned only for Win32 system errors.
  892.       Call SioError to format the textual error message.
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      WSC4VB Reference Manual                                   Page 15
  901.  
  902.       +-----------+-------------------------------------------------------+
  903.       | mioBreak  |  Aborts the Modem I/O state driver.                   |
  904.       +-----------+-------------------------------------------------------+
  905.  
  906.       Syntax Function mioBreak(ByVal Port)
  907.              ' Port : Port selected.
  908.  
  909.       Remark Forces the MIO driver to the IDLE state, abandoning any work
  910.              in progress (if any). Used to abort mioSendTo, mioQuiet, and
  911.              mioWaitFor functins.
  912.  
  913.       Return MIO_IDLE.
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.       +------------+------------------------------------------------------+
  922.       | mioDriver  |  Modem I/O state driver.                             |
  923.       +------------+------------------------------------------------------+
  924.  
  925.       Syntax Function mioDriver(ByVal Port)
  926.              ' Port : Port selected.
  927.  
  928.       Remark Executes the next state of any previously started MIO Function
  929.              such as mioSendTo, mioWaitFor, and mioQuiet. Returns MIO_IDLE
  930.              (defined in MIO.PAS) if ready not running, MIO_RUNNING if
  931.              running, and anything else is a character from the modem that
  932.              can be displayed if wanted.
  933.  
  934.       Return  MIO_IDLE : if the driver is ready for the next mioSendTo,
  935.                            mioWaitFor, or mioQuiet.
  936.              MIO_RUNNING : if the driver is not idle.
  937.                   <else> : if the driver is not idle, and the returned
  938.                            character was received from the modem.
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.      WSC4VB Reference Manual                                   Page 16
  961.  
  962.       +-----------+-------------------------------------------------------+
  963.       | mioQuiet  |  Waits for Modem I/O state driver.                    |         *
  964.       +-----------+-------------------------------------------------------+
  965.  
  966.       Syntax Function mioQuiet(ByVal Port, ByVal Wait As Long)
  967.              ' Port : Port selected.
  968.              ' Wait : Wait in milliseconds.
  969.  
  970.       Remark The mioQuiet Function waits for continuous quiet [no incoming
  971.              serial data] of 'Wait' milliseconds before returning.  Any
  972.              incoming character while mioQuiet is running is lost.
  973.  
  974.       Return TRUE.
  975.  
  976.  
  977.  
  978.  
  979.       +------------+------------------------------------------------------+
  980.       | mioResult  |  Returns result of last mioWaitFor.                  |
  981.       +------------+------------------------------------------------------+
  982.  
  983.       Syntax Function mioResult(ByVal Port)
  984.              ' Port : Port selected.
  985.  
  986.       Remark The mioResult Function returns the result of the last
  987.              mioWaitFor Function. This Function should not be called until
  988.              the driver returns MIO_IDLE. See the remarks section of the
  989.              mioWaitFor Function for an example.
  990.  
  991.       Return  0 : False (last WaitFor not matched)
  992.              !0 : '0' if first substring matched, '1' if second substring
  993.              matched, etc.
  994.  
  995.        Other See mioWaitFor.
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.      WSC4VB Reference Manual                                   Page 17
  1021.  
  1022.       +-----------+-------------------------------------------------------+
  1023.       | mioSendTo |  Sends string to modem.                               |
  1024.       +-----------+-------------------------------------------------------+
  1025.  
  1026.       Syntax Function mioSendTo(ByVal Port, ByVal Pace As Long,
  1027.                                   Text As String)
  1028.              ' Port : Port selected.
  1029.              ' Pace : The inter-character delay in milliseconds.
  1030.              ' Text : The string to send.
  1031.  
  1032.       Remark The mioSendTo Function sends the characters in the string
  1033.              'Text' to serial output. There is a delay of 'Pace'
  1034.              milliseconds between characters.
  1035.  
  1036.       Return TRUE.
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.       +-------------+-----------------------------------------------------+
  1043.       | mioWaitFor  |  Waits for continuous quiet.                        |
  1044.       +-------------+-----------------------------------------------------+
  1045.  
  1046.       Syntax Function mioWaitFor(ByVal Port, ByVal Wait As Long,
  1047.                                  Text As String)
  1048.  
  1049.              ' Port : Port selected.
  1050.              ' Wait : Total time to wait for response (milliseconds).
  1051.              ' Text : The expected response string.
  1052.  
  1053.       Remark The mioWaitFor Function waits for characters from serial
  1054.              input that match the string 'Text'. A total of 'Wait'
  1055.              milliseconds are allowed before timing out and returning FALSE
  1056.              (0). The string comparison is NOT case sensitive.
  1057.  
  1058.              For example, to wait up to one minute for 'CONNECT', 'NO
  1059.              CARRIER', or 'BUSY' from the modem after dialing a number.
  1060.  
  1061.              Code = mioWaitFor(ByVal Port,60000,'CONNECT|NO CARRIER|BUSY')
  1062.  
  1063.              The Function mioDriver() must be called until MIO_IDLE is
  1064.              returned. Then mioResult() is called to get the result of the
  1065.              mioWaitFor.  A value of 0 indicates that neither 'CONNECT',
  1066.              'BUSY', nor 'NO CARRIER' was received. A non-zero value
  1067.              indicates that one of the three sub-strings was received.  A
  1068.              '0' is returned if 'CONNECT' was seen, '1' is returned if 'NO
  1069.              CARRIER' was seen, and '2' is returned if 'BUSY' was seen.
  1070.  
  1071.       Return TRUE.
  1072.  
  1073.        Other See mioResult.
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.      WSC4VB Reference Manual                                   Page 18
  1081.  
  1082.       +---------+---------------------------------------------------------+
  1083.       | xyAbort | Aborts the XYDRIVER state driver.                       |
  1084.       +---------+---------------------------------------------------------+
  1085.  
  1086.       Syntax Function xyAbort(ByVal Port)
  1087.              ' Port :  Port selected.
  1088.  
  1089.       Remark The xyAbort Function forces the driver to IDLE, terminating
  1090.              any file transfer which may be in progress.
  1091.  
  1092.       Return XY_NO_ERROR (0).
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.       +-----------+-------------------------------------------------------+
  1100.       | xyAcquire | Prepares the state driver for operation.              |
  1101.       +-----------+-------------------------------------------------------+
  1102.  
  1103.       Syntax Function xyAcquire(ByVal Port)
  1104.              ' Port :  Port selected.
  1105.  
  1106.  
  1107.       Remark The xyAcquire Function initializes the driver for subsequent
  1108.              use. This should be the first driver Function called.
  1109.  
  1110.       Return =0 : No error (XY_NO_ERROR).
  1111.              <0 : XYDRIVER error. See .XYDRIVER Error Codes.
  1112.  
  1113.        Other See xyRelease.
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.      WSC4VB Reference Manual                                   Page 19
  1141.  
  1142.       +----------+--------------------------------------------------------+
  1143.       | xyDebug  | Set the driver debug level.                            |
  1144.       +----------+--------------------------------------------------------+
  1145.  
  1146.       Syntax Function xyDebug(ByVal DebugLevel)
  1147.              ' DebugLevel : Debug level value.
  1148.  
  1149.       Remark The xyDebug Functions sets the driver debug level as follows:
  1150.  
  1151.              DebugLevel :  Meaning
  1152.                  0         Only error messages are generated [default].
  1153.                  1         Minimal debug messages are generated.
  1154.                  2         Maximal debug messages are generated.
  1155.  
  1156.              Debug messages are retrieved using the xyGetMessage Function.
  1157.  
  1158.       Returns New debug level [0,1,2]
  1159.  
  1160.  
  1161.  
  1162.  
  1163.       +----------+--------------------------------------------------------+
  1164.       | xyDriver | XMODEM / YMODEM state driver.                          |
  1165.       +----------+--------------------------------------------------------+
  1166.  
  1167.       Syntax Function xyDriver(ByVal Port)
  1168.              ' Port :  Port selected.
  1169.  
  1170.       Return    XY_IDLE : A transfer is not underway.
  1171.              XY_RUNNING : A transfer is underway.
  1172.  
  1173.       Remark The xyDriver Function drives the state engine. It is normally
  1174.              called within a timer loop. Note that xyDriver never returns
  1175.              an error code.
  1176.  
  1177.              xyDriver can be called as often as wanted whether or not a
  1178.              file transfer was initiated.
  1179.  
  1180.        Other See xyStartTx and xyStartRx.
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.      WSC4VB Reference Manual                                   Page 20
  1201.  
  1202.       +--------------+----------------------------------------------------+
  1203.       | xyGetMessage |  Get next XYDRIVER message.                        |
  1204.       +--------------+----------------------------------------------------+
  1205.  
  1206.       Syntax Function xyGetMessage(Buffer As String, ByVal Size)
  1207.              ' Buffer : Message buffer.
  1208.              ' Size   : Size of message buffer.
  1209.  
  1210.       Remark The xyGetMessage Function retieves the next message from the
  1211.              driver message queue. Refer to the TERM.C example program for
  1212.              an example of using xyGetMessage.
  1213.  
  1214.       Return  TRUE : A message was copied into Buffer.
  1215.              FALSE : No messages are available.
  1216.  
  1217.        Other See xyDebug.
  1218.  
  1219.  
  1220.  
  1221.       +----------------+--------------------------------------------------+
  1222.       | xyGetParameter | Retrieves driver parameter.                      |
  1223.       +----------------+--------------------------------------------------+
  1224.  
  1225.       Syntax Function xyGetParameter(ByVal Port, ByVal Parameter) As Long
  1226.              ' Port      : Port Selected.
  1227.              ' Parameter : Parameter to return.
  1228.  
  1229.       Remark The driver parameter corresponding to the following table is
  1230.              returned.
  1231.  
  1232.                        Parameter :  Desciption
  1233.                XY_GET_ERROR_CODE : Driver error code (see XYDRIVER.PAS)
  1234.               XY_GET_ERROR_STATE : Error state (if in error).
  1235.                    XY_GET_PACKET : Current packet number.
  1236.                     XY_GET_STATE : Current state (ss XYDRIVER.C).
  1237.                 XY_GET_FILE_SIZE : File size.
  1238.                  XY_GET_NBR_NAKS : Number of packets ACKed.
  1239.                  XY_GET_LAST_GET : Last incoming (serial) character.
  1240.                  XY_GET_LAST_PUT : Last outgoing (serial) character.
  1241.                 XY_GET_GET_COUNT : Number of incoming characters (bytes).
  1242.                 XY_GET_PUT_COUNT : Number of outgoing characters (bytes).
  1243.              XY_GET_DRIVER_COUNT : Number times xyDriver() was called.
  1244.                               -1 : Cannot recognize parameter.
  1245.  
  1246.              The xyGetParameter Function can be used to check the state of
  1247.              the driver. For example:
  1248.  
  1249.             (1) xyGetParameter(ByVal Port,XY_GET_STATE) returns XY_IDLE if idle.
  1250.             (2) xyGetParameter(ByVal Port,XY_GET_ERROR_CODE) returns the driver
  1251.                 error code if an error has occurred or XY_NO_ERROR (0)
  1252.                 otherwise.
  1253.  
  1254.       Return See above.
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.      WSC4VB Reference Manual                                   Page 21
  1261.  
  1262.       +-----------+-------------------------------------------------------+
  1263.       | xyRelease | Releases driver port.                                 |
  1264.       +-----------+-------------------------------------------------------+
  1265.  
  1266.       Syntax Function xyRelease(ByVal Port)
  1267.              ' Port : Port selected.
  1268.  
  1269.       Remark The xyRelease Function releases a port that was previously
  1270.              acquired with xyAcquire. This Function should be called before
  1271.              calling the WSC Function SioDone.
  1272.  
  1273.       Return  0 : No error (XY_NO_ERROR).
  1274.              <0 : XYDRIVER error. See .XYDRIVER Error Codes.
  1275.  
  1276.        Other See xyAcquire.
  1277.  
  1278.  
  1279.       +-----------+-------------------------------------------------------+
  1280.       | xyStartRx | Start XMODEM or YMODEM receive.                       |
  1281.       +-----------+-------------------------------------------------------+
  1282.  
  1283.       Syntax Function xyStartRx(ByVal Port, Filename As String,
  1284.                                 ByVal NCGchar, ByVal Batch)
  1285.              ' Port     : Port to use.
  1286.              ' Filename : File to receive (XMODEM only).
  1287.              ' NCGchar  : NAK, 'C', or 'G'.
  1288.              ' Batch    : YMODEM flag (T/F).
  1289.  
  1290.       Remark The xyStartRx starts the XMODEM or YMODEM file receive. Once
  1291.              started, calls to xyDriver are made to execute the next state
  1292.              (or states). The xyStartTx Function returns immediately.
  1293.  
  1294.              The protocols supported and their parameters are as follows:
  1295.  
  1296.              Protocol   :  NCGchar   BatchFlag  :  Comments
  1297.              XMODEM     :   NAK        FALSE       Standard XMODEM
  1298.              XMODEM/CRC :   'C'        FALSE
  1299.              XMODEM/1K  :   'C'        FALSE
  1300.              YMODEM     :   'C'        TRUE        Standard YMODEM
  1301.  
  1302.              The xyStart Function is used to receive a file using XMODEM or
  1303.              YMODEM.
  1304.  
  1305.       Return =0 : No error (XY_NO_ERROR).
  1306.              <0 : Driver error. See .XYDRIVER Error Codes. a list of errors.
  1307.  
  1308.        Other See xyStartTx and xyDriver.
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.      WSC4VB Reference Manual                                   Page 22
  1321.  
  1322.       +-----------+-------------------------------------------------------+
  1323.       | xyStartTx | Start XMODEM or YMODEM transmit.                      |
  1324.       +-----------+-------------------------------------------------------+
  1325.  
  1326.       Syntax Function xyStartTx(ByVal Port, Filename As String,
  1327.                                 ByVal OneKflag, ByVal Batch)
  1328.              ' Port     : Port to use.
  1329.              ' Filename : File to send.
  1330.              ' OneK     : Want 1K blocks (T/F).
  1331.              ' Batch    : YMODEM flag (T/F).
  1332.  
  1333.       Remark The xyStartTx starts the XMODEM or YMODEM file send. Once
  1334.              started, calls to xyDriver are made to execute the next state
  1335.              (or states). The xyStartTx Function returns immediately.
  1336.  
  1337.              The protocols supported and their parameters are as follows:
  1338.  
  1339.              Protocol   :  OneKflag  BatchFlag : Comments
  1340.              XMODEM     :   FALSE      FALSE     Standard XMODEM
  1341.              XMODEM/CRC :   FALSE      FALSE
  1342.              XMODEM/1K  :   TRUE       FALSE
  1343.              YMODEM     :   TRUE       TRUE      Standard YMODEM
  1344.  
  1345.       Return =0 : No error (XY_NO_ERROR).
  1346.              <0 : Driver error. See XTDRIVER.PAS for a list of errors.
  1347.  
  1348.        Other See xyStartRx and xyDriver.
  1349.  
  1350.                          XYDRIVER Error Codes
  1351.  
  1352.       Error codes are always negative, except for 'no error'. Most of these
  1353.       error conditions rarely occur. Also note that XYDRIVER Functions can
  1354.       return WSC errors. An error message is queued when an error occurs
  1355.       which can be retrieved with xyGetMessage.
  1356.  
  1357.       The numeric values for error codes can be found in XYDRIVER.PAS.
  1358.  
  1359.       +--------------------------+----------------------------------------+
  1360.       |              XY_NO_ERROR | No error. (0)                          |
  1361.       |         XY_UNKNOWN_ERROR | Unknown error.                         |
  1362.       |  XY_ALREADY_ACTIVE_ERROR | Port already acquired.                 |
  1363.       |     XY_CANNOT_OPEN_ERROR | Cannot open specifed file.             |
  1364.       |      XY_EMPTY_FILE_ERROR | Specified file is empty.               |
  1365.       | XY_NO_STARTUP_CHAR_ERROR | Must specify NAK, 'C', or 'G'.         |
  1366.       |         XY_NOT_NCG_ERROR | Expected NAK, 'C', or 'G'.             |
  1367.       |       XY_DISK_READ_ERROR | Error reading disk.                    |
  1368.       |      XY_NO_EOT_ACK_ERROR | EOT was not ACKed.                     |
  1369.       |        XY_INTERNAL_ERROR | Internal error!                        |
  1370.       |       XY_CANCELLED_ERROR | Other side cancelled.                  |
  1371.       |     XY_OUT_OF_SYNC_ERROR | Protocol has lost synchronization.     |
  1372.       |         XY_RETRIES_ERROR | Packet retry limit was exceeded.       |
  1373.       |  XY_BAD_PACKET_NBR_ERROR | Incorrect packet number.               |
  1374.       |       XY_TIMED_OUT_ERROR | Timed out waiting for other side.      |
  1375.       |    XY_NO_SUCH_FILE_ERROR | No such file.                          |
  1376.       |      XY_NOT_ACTIVE_ERROR | Port not acquired by xyAcquire.        |
  1377.       |      XY_PORT_RANGE_ERROR | Port number out of range.              |
  1378.       +--------------------------+----------------------------------------+
  1379.  
  1380.      WSC4VB Reference Manual                                   Page 23
  1381.  
  1382.  
  1383.